package goRpc

import (
	"github.com/flipped-aurora/gin-vue-admin/server/goRpc/req"
	"github.com/flipped-aurora/gin-vue-admin/server/goRpc/res"
)

type ExaFileUploadAndDownloadRpc struct{}

func (r ExaFileUploadAndDownloadRpc) Upload(req *req.ExaFileUploadAndDownloadReq, reply *res.Response) error {
	file, err := fileUploadAndDownloadService.UploadFile(req.Header, req.NoSave)
	if err != nil {
		return err
	}

	*reply = res.OkWithData(file)

	return nil
}
